can refer to the reference section of the built-in document of logparser. Here we take EVT (event) as an example:
2. Output Source
The output can be in multiple formats, such as text (CSV, etc.) or written to a database to form a chart. custom files (using TPL) can be formed based on your own needs.
Basic query Structure
After learning about the input and output sources, let's look at a basic query structure.
Logparser.exe-I: EVT-o: DATAGRID "SELECT * FROM E: \ logparser \ xx.
(Registry), etc, for each input source, the field values it covers are fixed. You can use logparser-h-I: EVT To Find Out (Here we use EVT as an example ):
Here are some optional parameters. You can control the query results during query, however, we need to focus on the field values contained in a certain type of log structure (matching specific segments in SQL queries ):
For the detailed meaning of each type of field value, we can refer to the reference section of the built-in document o
DOS saves system logs and dos saves logs
1. Export System logs, named after the current date
@ Echo offSet nowDate = % date %Set tmp = % nowDate :~ 0,-3%.Set file = % tmp:/=-% system log. evtx
Echo % nowDate %> % file %
Wevtutil epl system >>% file %
========================================================== ============
2. wevtutil: DOS log command
View All windows Log categories by wevtutil el
Wevtutil epl setup C: \ setup.
1.log File storage location:File name ends with. evtXp/windows Server 2003:%SystemRoot%\System32\ConfigWindows vista/7/server2008 location,%systemroot%\system32\winevt\logs2. Open Event Log View:eventvwr.msc3. Microsoft recommends that log files be up to around 300M4. After the log is full, the automatic backup mechanism: http://technet.microsoft.com/en-us/library/cc721981.aspx5. Log Management tool WevtUtil.exe:Example: The following example clears all events from the Application log after the
MSSQL.3: SQLExpress
MSSQL.4: SSRS
Therefore, in general, you only need to pay attention to the log files under the MSSSQL.1 directory
So where is the database Mail Log Record located? Where are the job history logs and Windows application logs? Have you ever considered this?
The database mail log record information can be queried from the msdb. dbo. sysmail_event_log view and saved in the [dbo]. [sysmail_log] table.
Sysmail_event_log
The job history log information is saved in the table
defines three types of logs: Application, Security, and system. The file names are AppEvent. evt, SecEvent. evt and SysEvent. evt. these files are used to store the Registry file and configuration information under the CONFIG directory % SystemRoot % \ SYSTEM32 \ CONFIG \
Windows Vista adds log categories such as HardvareEvents and DFS Replication, and creates a separate directory for all log files, that is, % SystemRoot % \ SYSTEM32 \ winevt \ Logs directory, the log file extension is also com
; "Width=" 751 "height=" 103 "title=" Enable-storagediagnosticlog.png "style=" width:750px;height : 84px; "src=" Https://s1.51cto.com/wyfs02/M02/98/CB/wKioL1lArMqTHZkfAABUOrHulJI900.png "alt=" Wkiol1larmqthzkfaabuorhulji900.png "/>3. We then use the following command to collect the relevant logs and place the collected logs in the C:\tmp directory:Get-storagediagnosticinfo-storagesubsystemfriendlyname *cluster*-destinationpath C:\tmp-Verbose650) this.width=650; "width=" 814 "height=" 183 "title=
Sometimes you may need to analyze system files to transfer them to the hard drive, or you want to read the system log directly from "EVTX".
You can do this:
Copy Code code as follows:
$path = "$env: windir\system32\winevt\logs\setup.evtx"
Get-winevent-path $path
Another piece of code to get the system log
Copy Code code as follows:
$StartTime = (get-date). Date + (new-timespan-hours 6-minutes 35)
$EndTime = (
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.